package co.yixiang.shop.mapper;

import co.yixiang.shop.domain.StoreGoods;
import co.yixiang.shop.domain.StoreGoodsImages;
import co.yixiang.shop.domain.StoreGoodsImagesUrl;
import co.yixiang.shop.vo.StoreGoodsImagesVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StoreGoodsImagesMapper {

    /**
     * 新增商品主
     *
     * @param
     * @return 结果
     */
    public int insertGoodsImages(StoreGoodsImages storeGoodsImages);


    @Select("select * from store_goods_images")
    public List<StoreGoodsImages> list();

    @Select("select * from store_good_images_url  where img_id=#{img_id}")
    public List<StoreGoodsImagesUrl> getimg_id(Integer img_id);


    ///  新增图片组
    @Insert("insert into store_goods_images (goods_id, image_name) values (0, #{image_name})")
    public int InsertImages(String image_name);

    ///  新增图片组项
    @Insert("insert into store_good_images_url (image_url, img_id) values (#{image_url}, #{img_id})")
    public int InsertImagesUrl(@Param("image_url")String image_url, @Param("img_id") Integer img_id);


    ///  查询图片组
    @Select("select * from store_goods_images  where image_name=#{image_name}")
    public StoreGoodsImagesVo getImages(String image_name);

    ///  模糊查询图片组
    @Select("select * from store_goods_images  where image_name like #{image_name}")
    public List<StoreGoodsImages> getImagesLike(String image_name);

}
